package com.laguille.games.tetris.model.Tetromino.impl;

import com.laguille.games.tetris.model.Field;
import com.laguille.games.tetris.model.Tetromino.Coordinates;
import com.laguille.games.tetris.model.Tetromino.TetrominoBlock;
import com.laguille.games.tetris.model.Tetromino.TetrominoPiece;

public class OPiece extends TetrominoPiece {

	public OPiece()
	{
		super();
		blocks[0] = new TetrominoBlock(new Coordinates((Field.WIDTH / 2) - 1, Field.HEIGHT - 1));
		blocks[1] = new TetrominoBlock(new Coordinates((Field.WIDTH / 2) - 1, Field.HEIGHT - 2));
		blocks[2] = new TetrominoBlock(new Coordinates(Field.WIDTH / 2, Field.HEIGHT - 1));
		blocks[3] = new TetrominoBlock(new Coordinates(Field.WIDTH / 2, Field.HEIGHT - 2));
	}
	
	public OPiece(Coordinates...coordinates)
	{
		super(coordinates);
	}

	@Override
	public TetrominoPiece rotateLeft()
	{
		return new OPiece(blocks[0].getCoordinates(), blocks[1].getCoordinates(), blocks[2].getCoordinates(), blocks[3].getCoordinates());
	}

	@Override
	public TetrominoPiece rotateRight() {
		return new OPiece(blocks[0].getCoordinates(), blocks[1].getCoordinates(), blocks[2].getCoordinates(), blocks[3].getCoordinates());
	}
	

}
